package Event;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class Listner implements MyCommandListner{
    JTextField textInput;
    JTextArea textShow;
    public void setJTextField(JTextField text){
        textInput=text;
    }
    public void setJTextArea(JTextArea area){
        textShow=area;
    }
    public void actionPerformed(ActionEvent e){
        String str= textInput.getText();
        textShow.append(str+"的长度为："+str.length()+"\n");
    }
}
